<?php 
	header("Content-Type: text/html;charset=utf-8");

	$conn = new mysqli("localhost", "root", "456789", "mysqlstudy");
	if($conn -> connect_error){
		die("连接失败：". $conn -> connect_error);
	}
	mysqli_query($conn, "set names utf8");

	$sql = "SELECT * FROM tp_user_info WHERE uid=8";
	$result = $conn -> query($sql);
	$obj = $result -> fetch_assoc();
	//print_r($obj);

?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>查询数据库</title>
</head>
<body>
	昵称：<input type="text" name="username" readonly value="<?php echo $obj["username"]?>"><br>
	手机：<input type="text" name="tel" readonly value="<?php echo $obj["tel_phone"]?>"><br>
	邮箱：<input type="email" name="email" readonly value="<?php echo $obj["email"]?>"><br>
	密码：<input type="password" name="password" readonly value="<?php echo $obj["password"]?>"><br>
	上传头像：<img id="imgHead" src="<?php echo $obj["headimg"]?>" style="width: 160px; height: 170px; border: solid 1px #d2e2e2;"/>
	
	
</body>
</html>